12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259 |
- (() => {
- var exports = {};
- exports.id = 39883;
- exports.ids = [39883,64820];
- exports.modules = {
- /***/ 50478:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (/* binding */ pageWrapperTemplate),
- /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps),
- /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
- /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
- /* harmony export */ });
- /* harmony import */ var _sentry_server_config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96270);
- /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58097);
- /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20997);
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16689);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60866);
- /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var swr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15941);
- /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92684);
- /* harmony import */ var _components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25869);
- /* harmony import */ var _components_QuranReader_ReflectionView_ReflectionBodyContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(86325);
- /* harmony import */ var _lib_og__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(11670);
- /* harmony import */ var _pages_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(36049);
- /* harmony import */ var _pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(23848);
- /* harmony import */ var _pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20__);
- /* harmony import */ var _redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17241);
- /* harmony import */ var _utils_api__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4917);
- /* harmony import */ var _utils_apiPaths__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46127);
- /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(95892);
- /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(24709);
- /* harmony import */ var _utils_navigation__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(57933);
- /* harmony import */ var _utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36342);
- /* harmony import */ var _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(45137);
- /* harmony import */ var _utils_validator__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(41051);
- /* harmony import */ var _utils_verse__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(44519);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([swr__WEBPACK_IMPORTED_MODULE_5__, _components_QuranReader_ReflectionView_ReflectionBodyContainer__WEBPACK_IMPORTED_MODULE_8__, _pages_error__WEBPACK_IMPORTED_MODULE_9__, _utils_navigation__WEBPACK_IMPORTED_MODULE_15__]);
- ([swr__WEBPACK_IMPORTED_MODULE_5__, _components_QuranReader_ReflectionView_ReflectionBodyContainer__WEBPACK_IMPORTED_MODULE_8__, _pages_error__WEBPACK_IMPORTED_MODULE_9__, _utils_navigation__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
- const SelectedAyahReflection = ({ hasError , chapter , verseNumber , chapterId , fallback , })=>{
- const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4___default()("quran-reader");
- if (hasError) {
- return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_pages_error__WEBPACK_IMPORTED_MODULE_9__["default"], {
- statusCode: 500
- });
- }
- const navigationUrl = (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_15__/* .getVerseReflectionNavigationUrl */ .HT)(`${chapterId}:${verseNumber}`);
- return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
- children: [
- /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
- title: `${chapter.chapter.transliteratedName} - ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_14__/* .toLocalizedNumber */ .rQ)(Number(verseNumber), lang)} ${t("common:reflections")} `,
- image: (0,_lib_og__WEBPACK_IMPORTED_MODULE_19__/* .getChapterOgImageUrl */ .oJ)({
- chapterId,
- verseNumber,
- locale: lang
- }),
- imageWidth: 1200,
- imageHeight: 630,
- canonical: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_15__/* .getCanonicalUrl */ .Z2)(lang, navigationUrl),
- languageAlternates: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_14__/* .getLanguageAlternates */ .qc)(navigationUrl),
- description: t("reflections-desc", {
- ayahNumber: verseNumber,
- surahName: chapter.chapter.transliteratedName
- })
- }),
- /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(swr__WEBPACK_IMPORTED_MODULE_5__.SWRConfig, {
- value: {
- fallback
- },
- children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: (_pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20___default().pageContainer),
- children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: (_pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20___default().flow),
- children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: (_pages_index_module_scss__WEBPACK_IMPORTED_MODULE_20___default().flowItem),
- children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_QuranReader_ReflectionView_ReflectionBodyContainer__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
- scrollToTop: _utils_navigation__WEBPACK_IMPORTED_MODULE_15__/* .scrollWindowToTop */ .hb,
- initialChapterId: chapterId,
- initialVerseNumber: verseNumber.toString(),
- render: ({ body , surahAndAyahSelection })=>{
- return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
- children: [
- surahAndAyahSelection,
- body
- ]
- });
- }
- })
- })
- })
- })
- })
- ]
- });
- };
- const getStaticProps$1 = async ({ params , locale })=>{
- const { chapterId } = params;
- const verseKey = String(chapterId);
- const chaptersData = await (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_13__/* .getAllChaptersData */ .T4)(locale);
- if (!(0,_utils_validator__WEBPACK_IMPORTED_MODULE_17__/* .isValidVerseKey */ .CG)(chaptersData, verseKey)) {
- return {
- notFound: true
- };
- }
- const [chapterNumber, verseNumber] = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_18__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey);
- const { quranFont , mushafLines } = (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_10__/* .getQuranReaderStylesInitialState */ .kq)(locale);
- const translations = (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_10__/* .getTranslationsInitialState */ .h0)(locale).selectedTranslations;
- try {
- const verseReflectionUrl = (0,_utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_16__/* .makeAyahReflectionsUrl */ .pZ)({
- surahId: chapterNumber,
- ayahNumber: verseNumber,
- locale
- });
- const mushafId = (0,_utils_api__WEBPACK_IMPORTED_MODULE_11__/* .getMushafId */ .$P)(quranFont, mushafLines).mushaf;
- const apiParams = {
- ...(0,_utils_api__WEBPACK_IMPORTED_MODULE_11__/* .getDefaultWordFields */ .hD)(quranFont),
- translationFields: "resource_name,language_id",
- translations: translations.join(","),
- mushaf: mushafId,
- from: `${chapterNumber}:${verseNumber}`,
- to: `${chapterNumber}:${verseNumber}`
- };
- const versesUrl = (0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_12__/* .makeVersesUrl */ .ML)(chapterNumber, locale, apiParams);
- const [verseReflectionsData, versesData] = await Promise.all([
- (0,_utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_16__/* .getAyahReflections */ .Jc)(verseReflectionUrl),
- (0,_api__WEBPACK_IMPORTED_MODULE_6__/* .fetcher */ ._i)(versesUrl),
- ]);
- const fallback = {
- [verseReflectionUrl]: verseReflectionsData,
- [versesUrl]: versesData
- };
- return {
- props: {
- chaptersData,
- chapterId: chapterNumber,
- chapter: {
- chapter: (0,_utils_chapter__WEBPACK_IMPORTED_MODULE_13__/* .getChapterData */ .dy)(chaptersData, chapterNumber)
- },
- verseNumber,
- fallback
- },
- revalidate: _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_21__/* .ONE_WEEK_REVALIDATION_PERIOD_SECONDS */ .Dp
- };
- } catch (error) {
- return {
- props: {
- hasError: true
- },
- revalidate: _utils_staticPageGeneration__WEBPACK_IMPORTED_MODULE_21__/* .REVALIDATION_PERIOD_ON_ERROR_SECONDS */ .eW
- };
- }
- };
- const getStaticPaths = async ()=>({
- paths: [],
- fallback: "blocking"
- });
- var serverComponentModule = /*#__PURE__*/Object.freeze({
- __proto__: null,
- getStaticProps: getStaticProps$1,
- getStaticPaths: getStaticPaths,
- 'default': SelectedAyahReflection
- });
- /*
- * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the
- * `pages/` directory.
- *
- * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,
- * this causes both TS and ESLint to complain, hence the pragma comments below.
- */
- const userPageModule = serverComponentModule ;
- const pageComponent = userPageModule ? userPageModule.default : undefined;
- const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;
- const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
- const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const getInitialPropsWrappers = {
- '/_app': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapAppGetInitialPropsWithSentry,
- '/_document': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapDocumentGetInitialPropsWithSentry,
- '/_error': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapErrorGetInitialPropsWithSentry,
- };
- const getInitialPropsWrapper = getInitialPropsWrappers['/[chapterId]/reflections'] || _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetInitialPropsWithSentry;
- if (pageComponent && typeof origGetInitialProps === 'function') {
- pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;
- }
- const getStaticProps =
- typeof origGetStaticProps === 'function'
- ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetStaticPropsWithSentry(origGetStaticProps, '/[chapterId]/reflections')
- : undefined;
- const getServerSideProps =
- typeof origGetServerSideProps === 'function'
- ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/[chapterId]/reflections')
- : undefined;
- const pageWrapperTemplate = pageComponent ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapPageComponentWithSentry(pageComponent ) : pageComponent;
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 5293:
- /***/ ((module) => {
- // Exports
- module.exports = {
- "container": "TafsirView_container__R9G7I",
- "tafsirName": "TafsirView_tafsirName__QPOiO",
- "tafsirContainer": "TafsirView_tafsirContainer__g2rhW",
- "rtl": "TafsirView_rtl__8pRLP",
- "surahAndAyahSelectionContainer": "TafsirView_surahAndAyahSelectionContainer__W96nf",
- "tafsirSelectionContainer": "TafsirView_tafsirSelectionContainer__QSkE3",
- "tafsirSelectionItem": "TafsirView_tafsirSelectionItem__GTJvw",
- "tafsirItemSelected": "TafsirView_tafsirItemSelected__SXceL",
- "separatorContainer": "TafsirView_separatorContainer__diS8n",
- "verseTextContainer": "TafsirView_verseTextContainer__A7tZ_",
- "selectionItem": "TafsirView_selectionItem__FJdhi",
- "ayahSelection": "TafsirView_ayahSelection__jWULb",
- "tafsirSkeletonItem": "TafsirView_tafsirSkeletonItem__q5sNk",
- "ayahSekletonItem": "TafsirView_ayahSekletonItem__B_nJN",
- "tafsirSkeletonItem1": "TafsirView_tafsirSkeletonItem1__nLGRk",
- "tafsirSkeletonItem2": "TafsirView_tafsirSkeletonItem2__aaEJy",
- "tafsirSkeletonItem3": "TafsirView_tafsirSkeletonItem3__NqYKV",
- "tafsirSelectionSkeleton": "TafsirView_tafsirSelectionSkeleton__3oq7k",
- "languageSelection": "TafsirView_languageSelection__8EFqZ",
- "tafsir-font-size-1": "TafsirView_tafsir-font-size-1__sLRnq",
- "tafsir-font-size-2": "TafsirView_tafsir-font-size-2__JLiR2",
- "tafsir-font-size-3": "TafsirView_tafsir-font-size-3__K0LBa",
- "tafsir-font-size-4": "TafsirView_tafsir-font-size-4__KrD1k",
- "tafsir-font-size-5": "TafsirView_tafsir-font-size-5__ri_Mr",
- "tafsir-font-size-6": "TafsirView_tafsir-font-size-6__FvBko",
- "tafsir-font-size-7": "TafsirView_tafsir-font-size-7__oS0XU",
- "tafsir-font-size-8": "TafsirView_tafsir-font-size-8__1U_43",
- "tafsir-font-size-9": "TafsirView_tafsir-font-size-9__6VJC2",
- "tafsir-font-size-10": "TafsirView_tafsir-font-size-10__zRYWI"
- };
- /***/ }),
- /***/ 96318:
- /***/ ((module) => {
- // Exports
- module.exports = {
- "baseSize": "Skeleton_baseSize__RsOkc",
- "skeleton": "Skeleton_skeleton__u2Uso",
- "active": "Skeleton_active__5df2K",
- "loading": "Skeleton_loading__iZh50",
- "rounded": "Skeleton_rounded__ftYYr",
- "content": "Skeleton_content__knKtV"
- };
- /***/ }),
- /***/ 23848:
- /***/ ((module) => {
- // Exports
- module.exports = {
- "pageContainer": "index_pageContainer__Pxtn3",
- "loadingContainer": "index_loadingContainer__WEZFc",
- "flow": "index_flow__rCTR5",
- "flowItem": "index_flowItem__GnXWz",
- "additionalVerticalGap": "index_additionalVerticalGap__nzYz6",
- "fullWidth": "index_fullWidth__1n4ux"
- };
- /***/ }),
- /***/ 86325:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96954);
- /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dynamic__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60866);
- /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _components_DataFetcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12951);
- /* harmony import */ var _components_QuranReader_observer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94082);
- /* harmony import */ var _components_QuranReader_TafsirView_TafsirSkeleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1627);
- /* harmony import */ var _hooks_useGlobalIntersectionObserverWithDelay__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91398);
- /* harmony import */ var _utils_auth_login__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22197);
- /* harmony import */ var _utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91450);
- /* harmony import */ var _utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(36342);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_DataFetcher__WEBPACK_IMPORTED_MODULE_4__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_7__]);
- ([_components_DataFetcher__WEBPACK_IMPORTED_MODULE_4__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_7__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
- const ReflectionSurahAndAyahSelection = next_dynamic__WEBPACK_IMPORTED_MODULE_2___default()(null, {
- loadableGenerated: {
- modules: [
- "../components/QuranReader/ReflectionView/ReflectionBodyContainer/index.tsx -> " + "./ReflectionSurahAndAyahSelection"
- ]
- },
- ssr: false
- });
- const ReflectionBody = next_dynamic__WEBPACK_IMPORTED_MODULE_2___default()(null, {
- loadableGenerated: {
- modules: [
- "../components/QuranReader/ReflectionView/ReflectionBodyContainer/index.tsx -> " + "./ReflectionBody"
- ]
- },
- ssr: false,
- loading: _components_QuranReader_TafsirView_TafsirSkeleton__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z
- });
- const ReflectionBodyContainer = ({ render , initialChapterId , initialVerseNumber , scrollToTop })=>{
- const { 0: selectedChapterId , 1: setSelectedChapterId } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialChapterId);
- const { 0: selectedVerseNumber , 1: setSelectedVerseNumber } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialVerseNumber);
- const { lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3___default()();
- /**
- * Handle when the reflection is viewed:
- *
- * 1. If the user is logged in, we will call QDC's backend API.
- * 2. Otherwise, we will call QR's API directly.
- */ const onReflectionViewed = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((reflectionContainer)=>{
- const postId = reflectionContainer.getAttribute("data-post-id");
- if ((0,_utils_auth_login__WEBPACK_IMPORTED_MODULE_7__/* .isLoggedIn */ .jl)()) {
- // eslint-disable-next-line @typescript-eslint/no-empty-function
- (0,_utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_8__/* .postReflectionViews */ .GG)(postId).catch(()=>{});
- } else {
- // eslint-disable-next-line @typescript-eslint/no-empty-function
- (0,_utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_9__/* .postReflectionViews */ .GG)(postId).catch(()=>{});
- }
- }, []);
- (0,_hooks_useGlobalIntersectionObserverWithDelay__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({
- threshold: 1
- }, onReflectionViewed, _components_QuranReader_observer__WEBPACK_IMPORTED_MODULE_10__/* .REFLECTIONS_OBSERVER_ID */ .yG, "postId", "countAsViewedAfter");
- const renderBody = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((data)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(ReflectionBody, {
- data: data,
- selectedChapterId: selectedChapterId,
- selectedVerseNumber: selectedVerseNumber,
- setSelectedVerseNumber: setSelectedVerseNumber,
- scrollToTop: scrollToTop
- }), [
- scrollToTop,
- selectedChapterId,
- selectedVerseNumber
- ]);
- const body = /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_DataFetcher__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
- loading: _components_QuranReader_TafsirView_TafsirSkeleton__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
- queryKey: (0,_utils_quranReflect_apiPaths__WEBPACK_IMPORTED_MODULE_9__/* .makeAyahReflectionsUrl */ .pZ)({
- surahId: selectedChapterId,
- ayahNumber: selectedVerseNumber,
- locale: lang
- }),
- render: renderBody
- });
- return render({
- surahAndAyahSelection: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(ReflectionSurahAndAyahSelection, {
- selectedChapterId: selectedChapterId,
- selectedVerseNumber: selectedVerseNumber,
- setSelectedChapterId: setSelectedChapterId,
- setSelectedVerseNumber: setSelectedVerseNumber
- }),
- body
- });
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReflectionBodyContainer);
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 1627:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59003);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64042);
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5293);
- /* harmony import */ var _TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _dls_Skeleton_Skeleton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77048);
- const TafsirSkeleton = ()=>{
- return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
- children: [
- /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Skeleton_Skeleton__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
- className: ((_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tafsirSkeletonItem), (_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().ayahSekletonItem))
- }),
- lodash_range__WEBPACK_IMPORTED_MODULE_2___default()(1, 15).map((i)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Skeleton_Skeleton__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()((_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tafsirSkeletonItem), {
- [(_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tafsirSkeletonItem1)]: i % 1 === 0,
- [(_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tafsirSkeletonItem2)]: i % 2 === 0,
- [(_TafsirView_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tafsirSkeletonItem3)]: i % 3 === 0
- })
- }, i))
- ]
- });
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TafsirSkeleton);
- /***/ }),
- /***/ 94082:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "FW": () => (/* binding */ getOptions),
- /* harmony export */ "NM": () => (/* binding */ QURAN_READER_OBSERVER_ID),
- /* harmony export */ "s$": () => (/* binding */ getObservedVersePayload),
- /* harmony export */ "yG": () => (/* binding */ REFLECTIONS_OBSERVER_ID)
- /* harmony export */ });
- /**
- * The top -131.6px was calculated based on:
- *
- * 1. the height of emptySpacePlaceholder of navbar (3.6rem).
- * 2. the top padding of the QuranReader container (2rem).
- * 3. the top and bottom margin of the ReadingPreferenceSwitcher container (1.625rem).
- * 4. the top margin of the TranslationView container (1rem).
- *
- * and the total is 8.225rem around 131.6 pixels.
- */ const DEFAULT_ROOT_MARGIN = "-131.6px 0px -68% 0px";
- const OBSERVER_THRESHOLD = 0.1;
- const QURAN_READER_OBSERVER_ID = "quranReaderObserver";
- const REFLECTIONS_OBSERVER_ID = "reflectionsObserver";
- /**
- * the top -115.6px was calculated based on:
- *
- * 1. the height of emptySpacePlaceholder of navbar (3.6rem).
- * 2. the top padding of the QuranReader container (2rem).
- * 3. the top and bottom margin of the ReadingPreferenceSwitcher container (1.625rem).
- *
- * and the total is 7.225rem around 115.6 pixels.
- */ const READING_MODE_ROOT_MARGIN = "-115.6px 0px -70% 0px";
- /**
- * Get the observer options based on the reading preference.
- *
- * @param {boolean} isReadingPreference
- * @returns {{rootMargin: string, threshold: number | number[]}}
- */ const getOptions = (isReadingPreference)=>({
- rootMargin: isReadingPreference ? READING_MODE_ROOT_MARGIN : DEFAULT_ROOT_MARGIN,
- threshold: OBSERVER_THRESHOLD
- });
- /**
- * Get the payload that will be dispatched to Redux to set the last read verse.
- *
- * @param {Element} element
- * @returns {{verseKey: string,chapterId: string,page: string,hizb: string}}
- */ const getObservedVersePayload = (element)=>({
- verseKey: element.getAttribute("data-verse-key"),
- chapterId: element.getAttribute("data-chapter-id"),
- page: element.getAttribute("data-page"),
- hizb: element.getAttribute("data-hizb")
- });
- /***/ }),
- /***/ 77048:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59003);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96318);
- /* harmony import */ var _Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2__);
- const Skeleton = ({ children , isRounded , isSquared , isActive =true , className })=>{
- return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()((_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().skeleton), {
- [(_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().baseSize)]: !children && !className,
- [(_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().active)]: isActive,
- [(_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().rounded)]: isRounded,
- [(_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().squared)]: isSquared,
- [className]: className
- }),
- children: children && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
- className: (_Skeleton_module_scss__WEBPACK_IMPORTED_MODULE_2___default().content),
- children: children
- })
- });
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Skeleton);
- /***/ }),
- /***/ 44063:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /**
- * This is needed to avoid having the following warning:
- * Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format.
- * The solution is inspired by this thread
- * {@link https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85}
- */ // eslint-disable-next-line @typescript-eslint/no-empty-function
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ( false ? 0 : ()=>{});
- /***/ }),
- /***/ 91398:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _hooks_useBrowserLayoutEffect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44063);
- /* eslint-disable react-func/max-lines-per-function */
- const isDev = process.env.NEXT_PUBLIC_VERCEL_ENV === "development";
- /**
- * Sets a debugging text to element debugger node if we are in a dev environment
- * and the element debugger paragraph node exists.
- *
- * @param {string} text
- * @param {HTMLElement} intersectionDebuggerNode
- *
- */ const setIntersectionDebuggerNodeText = (text, intersectionDebuggerNode)=>{
- if (!isDev || !intersectionDebuggerNode) {
- return;
- }
- // eslint-disable-next-line no-param-reassign
- intersectionDebuggerNode.textContent = `OBSERVER DEBUGGER: ${text}`;
- };
- /**
- * A hook that will create a global observer and inject it into window so that it's
- * globally available. Once it's created, it can be used by any element that would like
- * to be observed using that observer using {@see useObserverElement} hook. This hook
- * is meant to be used for delayed element visibility callback.
- *
- * @param {IntersectionObserverInit} options
- * @param {(element:Element)=>void} onElementVisible
- * @param {string} observerId the name of the observer
- * @param {string} elementIdKey the key of the unique identifier of each element.
- * @param {string} delayForMSKey the key holding the number of milliseconds after which the observer should trigger the callback
- */ const useGlobalIntersectionObserverWithDelay = ({ threshold =1 , root =null , rootMargin ="0%" }, onElementVisible, observerId, elementIdKey, delayForMSKey)=>{
- /**
- * An object that will hold a reference of each unique identifier and
- * the ID of the timeout function that will trigger when the element
- * is visible for delayForMS number of seconds.
- */ const timeouts = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(new Map());
- const updateEntry = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((entries)=>{
- entries.forEach((visibleEntry)=>{
- let elementIntersectionDebuggerNode;
- if (isDev) {
- const nodes = visibleEntry.target.getElementsByClassName("debugger");
- // if at least one debugger node was found (should always be there but just to be extra sure)
- if (nodes.length) {
- elementIntersectionDebuggerNode = nodes[0];
- }
- }
- const targetNode = visibleEntry.target;
- const elementId = targetNode.dataset[elementIdKey];
- const delayForMS = Number(targetNode.dataset[delayForMSKey]);
- // if the element content container is interacting
- if (visibleEntry.isIntersecting) {
- setIntersectionDebuggerNodeText(`Element is fully visible, triggering callback in ${delayForMS / 1000} seconds...`, elementIntersectionDebuggerNode);
- // Call the API after delayForMS
- timeouts.current.set(elementId, window.setTimeout(()=>{
- onElementVisible(visibleEntry.target);
- setIntersectionDebuggerNodeText(`Element callback triggered`, elementIntersectionDebuggerNode);
- }, delayForMS));
- } else {
- // if it's no longer intersecting, clear the timeout
- clearTimeout(timeouts.current.get(elementId));
- /**
- * Delete the timeout function's ID from the global array since it's no longer
- * needed and next time if the same element intersects, a new ID will be generated
- * for that element.
- */ timeouts.current.delete(elementId);
- setIntersectionDebuggerNodeText(`Element is not fully visible, won't trigger callback`, elementIntersectionDebuggerNode);
- }
- });
- }, [
- delayForMSKey,
- elementIdKey,
- onElementVisible
- ]);
- /**
- * We need to assign to window before render is done since we want to the observer to be available by the time rendering is done so that the elements to be observed can use it.
- * {@see https://kentcdodds.com/blog/useeffect-vs-uselayouteffect}
- */ (0,_hooks_useBrowserLayoutEffect__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(()=>{
- const hasIOSupport = !!window.IntersectionObserver;
- if (!hasIOSupport) return undefined;
- // no need to create a new observer if it already exists.
- if (!window[observerId]) {
- window[observerId] = new IntersectionObserver(updateEntry, {
- threshold,
- root,
- rootMargin
- });
- }
- return ()=>{
- // manually clear all the timeouts (if any are still around)
- timeouts.current.forEach((value)=>{
- clearTimeout(value);
- });
- if (window[observerId]) {
- window[observerId].disconnect();
- window[observerId] = undefined;
- }
- };
- }, [
- root,
- rootMargin,
- threshold,
- updateEntry,
- observerId
- ]);
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useGlobalIntersectionObserverWithDelay);
- /***/ }),
- /***/ 11670:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "KT": () => (/* binding */ getAboutTheQuranImageUrl),
- /* harmony export */ "dJ": () => (/* binding */ getLearningPlansImageUrl),
- /* harmony export */ "oJ": () => (/* binding */ getChapterOgImageUrl),
- /* harmony export */ "qW": () => (/* binding */ getDefaultOgImageUrl)
- /* harmony export */ });
- const BASE_OG_URL = "https://og.qurancdn.com";
- const getDefaultOgImageUrl = ({ locale })=>`${BASE_OG_URL}/api/og?lang=${locale}`;
- const getAboutTheQuranImageUrl = ({ locale })=>`${BASE_OG_URL}/api/og/about-the-quran?lang=${locale}`;
- const getLearningPlansImageUrl = ({ locale })=>`${BASE_OG_URL}/api/og/learning-plans?lang=${locale}`;
- const getChapterOgImageUrl = ({ chapterId , locale , verseNumber })=>{
- const url = `${BASE_OG_URL}/api/og/chapter/${chapterId}?lang=${locale}`;
- if (!verseNumber) return url;
- return `${url}&verse=${verseNumber}`;
- };
- /***/ }),
- /***/ 91450:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Fp": () => (/* binding */ getQuranicCalendarPostOfWeek),
- /* harmony export */ "GG": () => (/* binding */ postReflectionViews),
- /* harmony export */ "P_": () => (/* binding */ followUser),
- /* harmony export */ "ST": () => (/* binding */ isUserFollowed)
- /* harmony export */ });
- /* unused harmony export getAllUserReflections */
- /* harmony import */ var _apiPaths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65899);
- /* harmony import */ var _utils_auth_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37883);
- const postReflectionViews = async (postId)=>(0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .postRequest */ .j0)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makePostReflectionViewsUrl */ .PI)(postId), {});
- const followUser = async (usernameOrId)=>(0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .postRequest */ .j0)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeFollowUserUrl */ .bE)(usernameOrId), {});
- const isUserFollowed = async (usernameOrId)=>{
- return (0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .privateFetcher */ .UK)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeIsUserFollowedUrl */ .BC)(usernameOrId));
- };
- const getAllUserReflections = async (params)=>{
- return privateFetcher(makeGetUserReflectionsUrl(params));
- };
- const getQuranicCalendarPostOfWeek = async (weekNumber)=>{
- return (0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .privateFetcher */ .UK)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeQuranicCalendarPostOfWeekUrl */ .Sv)(weekNumber));
- };
- /***/ }),
- /***/ 65899:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BC": () => (/* binding */ makeIsUserFollowedUrl),
- /* harmony export */ "PI": () => (/* binding */ makePostReflectionViewsUrl),
- /* harmony export */ "Sv": () => (/* binding */ makeQuranicCalendarPostOfWeekUrl),
- /* harmony export */ "YV": () => (/* binding */ makeGetUserReflectionsUrl),
- /* harmony export */ "bE": () => (/* binding */ makeFollowUserUrl)
- /* harmony export */ });
- /* harmony import */ var _utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13830);
- const getPrefixedUrl = (url)=>`qf/${url}`;
- const makePostReflectionViewsUrl = (postId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`posts/${postId}/views`));
- const makeFollowUserUrl = (userNameOrId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`users/${userNameOrId}/follow`));
- const makeIsUserFollowedUrl = (userNameOrId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`users/${userNameOrId}/is-followed`));
- const makeGetUserReflectionsUrl = (params)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl("posts"), params);
- const makeQuranicCalendarPostOfWeekUrl = (weekNumber)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`quranic-calendar/${weekNumber}`));
- /***/ }),
- /***/ 36342:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "Jc": () => (/* binding */ getAyahReflections),
- "pZ": () => (/* binding */ makeAyahReflectionsUrl),
- "GG": () => (/* binding */ postReflectionViews)
- });
- // UNUSED EXPORTS: API_HOST, makeQuranReflectApiUrl
- // EXTERNAL MODULE: ./src/api.ts
- var api = __webpack_require__(92684);
- // EXTERNAL MODULE: ./src/utils/qs-stringify.ts
- var qs_stringify = __webpack_require__(99921);
- ;// CONCATENATED MODULE: ./types/QuranReflect/Tab.ts
- var Tab;
- (function(Tab) {
- Tab["MostPopular"] = "most_popular";
- Tab["Newest"] = "newest";
- Tab["Feed"] = "feed";
- Tab["Public"] = "public";
- })(Tab || (Tab = {}));
- /* harmony default export */ const QuranReflect_Tab = (Tab);
- ;// CONCATENATED MODULE: ./src/utils/quranReflect/apiPaths.ts
- /* eslint-disable @typescript-eslint/naming-convention */
- const STAGING_API_HOST = "https://quranreflect.org";
- const PRODUCTION_API_HOST = "https://quranreflect.com";
- const isProd = process.env.NEXT_PUBLIC_VERCEL_ENV === "production";
- // env variables in Vercel can't be dynamic, we have to hardcode the urls here. https://stackoverflow.com/questions/44342226/next-js-error-only-absolute-urls-are-supported
- const API_HOST = isProd ? PRODUCTION_API_HOST : STAGING_API_HOST;
- const makeQuranReflectApiUrl = (path, parameters = {})=>{
- const params = {
- client_auth_token: process.env.NEXT_PUBLIC_QURAN_REFLECT_TOKEN,
- ...parameters
- };
- return `${API_HOST}/${path}?${(0,qs_stringify/* default */.Z)(params)}`;
- };
- /* eslint-disable import/prefer-default-export */ const makeAyahReflectionsUrl = ({ surahId , ayahNumber , locale , page =1 , tab =QuranReflect_Tab.MostPopular })=>{
- const surahNumber = Number(surahId) + 1;
- return makeQuranReflectApiUrl("posts.json", {
- "q[filters_attributes][0][chapter_id]": surahNumber,
- "q[filters_attributes][0][from]": ayahNumber,
- "q[filters_attributes][0][to]": ayahNumber,
- "q[filters_operation]": "OR",
- page,
- tab,
- lang: locale,
- feed: true
- });
- };
- const makeReflectionViewsUrl = (postId)=>{
- return makeQuranReflectApiUrl(`v1/posts/${postId}/views`);
- };
- const postReflectionViews = async (postId)=>(0,api/* fetcher */._i)(makeReflectionViewsUrl(postId), {
- method: "POST",
- headers: {
- "Content-Type": "application/json"
- }
- });
- const getAyahReflections = async (ayahReflectionsUrl)=>(0,api/* fetcher */._i)(ayahReflectionsUrl);
- /***/ }),
- /***/ 45137:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Dp": () => (/* binding */ ONE_WEEK_REVALIDATION_PERIOD_SECONDS),
- /* harmony export */ "eW": () => (/* binding */ REVALIDATION_PERIOD_ON_ERROR_SECONDS),
- /* harmony export */ "gi": () => (/* binding */ ONE_MONTH_REVALIDATION_PERIOD_SECONDS)
- /* harmony export */ });
- /* unused harmony export ONE_DAY_REVALIDATION_PERIOD_SECONDS */
- const REVALIDATION_PERIOD_ON_ERROR_SECONDS = 604800; // 7 days. TODO: @osama update the naming + value when we revert this back
- const ONE_DAY_REVALIDATION_PERIOD_SECONDS = 86400; // 1 day
- const ONE_WEEK_REVALIDATION_PERIOD_SECONDS = 604800; // 7 days
- const ONE_MONTH_REVALIDATION_PERIOD_SECONDS = 2592000; // 30 days
- /***/ }),
- /***/ 75184:
- /***/ ((module) => {
- "use strict";
- module.exports = require("@reduxjs/toolkit");
- /***/ }),
- /***/ 58097:
- /***/ ((module) => {
- "use strict";
- module.exports = require("@sentry/nextjs");
- /***/ }),
- /***/ 59003:
- /***/ ((module) => {
- "use strict";
- module.exports = require("classnames");
- /***/ }),
- /***/ 59606:
- /***/ ((module) => {
- "use strict";
- module.exports = require("humps");
- /***/ }),
- /***/ 12372:
- /***/ ((module) => {
- "use strict";
- module.exports = require("lodash/findKey");
- /***/ }),
- /***/ 98492:
- /***/ ((module) => {
- "use strict";
- module.exports = require("lodash/groupBy");
- /***/ }),
- /***/ 35526:
- /***/ ((module) => {
- "use strict";
- module.exports = require("lodash/random");
- /***/ }),
- /***/ 64042:
- /***/ ((module) => {
- "use strict";
- module.exports = require("lodash/range");
- /***/ }),
- /***/ 16641:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next-seo");
- /***/ }),
- /***/ 60866:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next-translate/useTranslation");
- /***/ }),
- /***/ 3280:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/app-router-context.js");
- /***/ }),
- /***/ 92796:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/head-manager-context.js");
- /***/ }),
- /***/ 3539:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
- /***/ }),
- /***/ 34014:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
- /***/ }),
- /***/ 78524:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/is-plain-object.js");
- /***/ }),
- /***/ 95832:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/loadable.js");
- /***/ }),
- /***/ 78020:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/mitt.js");
- /***/ }),
- /***/ 64406:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
- /***/ }),
- /***/ 24964:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router-context.js");
- /***/ }),
- /***/ 93431:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
- /***/ }),
- /***/ 11751:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
- /***/ }),
- /***/ 46220:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
- /***/ }),
- /***/ 10299:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
- /***/ }),
- /***/ 23938:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
- /***/ }),
- /***/ 29565:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
- /***/ }),
- /***/ 35789:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
- /***/ }),
- /***/ 1897:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
- /***/ }),
- /***/ 1428:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
- /***/ }),
- /***/ 28854:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
- /***/ }),
- /***/ 91292:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
- /***/ }),
- /***/ 34567:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
- /***/ }),
- /***/ 80979:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
- /***/ }),
- /***/ 93297:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
- /***/ }),
- /***/ 36052:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
- /***/ }),
- /***/ 84226:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
- /***/ }),
- /***/ 95052:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
- /***/ }),
- /***/ 59232:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/dist/shared/lib/utils.js");
- /***/ }),
- /***/ 71853:
- /***/ ((module) => {
- "use strict";
- module.exports = require("next/router");
- /***/ }),
- /***/ 16689:
- /***/ ((module) => {
- "use strict";
- module.exports = require("react");
- /***/ }),
- /***/ 20997:
- /***/ ((module) => {
- "use strict";
- module.exports = require("react/jsx-runtime");
- /***/ }),
- /***/ 52648:
- /***/ ((module) => {
- "use strict";
- module.exports = require("refresh-fetch");
- /***/ }),
- /***/ 66704:
- /***/ ((module) => {
- "use strict";
- module.exports = import("@radix-ui/react-tooltip");;
- /***/ }),
- /***/ 88813:
- /***/ ((module) => {
- "use strict";
- module.exports = import("firebase/compat/analytics");;
- /***/ }),
- /***/ 33773:
- /***/ ((module) => {
- "use strict";
- module.exports = import("firebase/compat/app");;
- /***/ }),
- /***/ 69915:
- /***/ ((module) => {
- "use strict";
- module.exports = import("js-cookie");;
- /***/ }),
- /***/ 15941:
- /***/ ((module) => {
- "use strict";
- module.exports = import("swr");;
- /***/ }),
- /***/ 79847:
- /***/ ((module) => {
- "use strict";
- module.exports = import("swr/immutable");;
- /***/ }),
- /***/ 63477:
- /***/ ((module) => {
- "use strict";
- module.exports = require("querystring");
- /***/ })
- };
- ;
- // load runtime
- var __webpack_require__ = require("../../webpack-runtime.js");
- __webpack_require__.C(exports);
- var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
- var __webpack_exports__ = __webpack_require__.X(0, [11497,79165,96954,96270,24709,57933,61239,25869,50497,76410,13830,37883,22197,12951,36049,41051], () => (__webpack_exec__(50478)));
- module.exports = __webpack_exports__;
- })();
- //# sourceMappingURL=reflections.js.map
|